<template>
	<view>
		
		<navigator hover-class="none" :url=" '/subpkg/goods_detail/goods_detail?cId=' + item.goods_id" >
						<view class="goods" >
									<view class="left-goods">
										<image :src="item.goods_small_logo || defalutImg" mode=""></image>
									</view>
									<view class="right-goods">
										<view class="goods-title">
											{{item.goods_name}}
										</view>
										<view class="goods-price">
											<!-- ¥{{item.goods_price.toFixed(2)}} -->
											¥{{item.goods_price | tofixed}}
										</view>
									</view>
						</view>
		</navigator>
		
	</view>
</template>

<script>
	export default {
		name:'goodsList',
		data() {
			return {}
		},
		filters:{
			// 把数字处理为带两位小数点的数字 
			tofixed(num) { return Number(num).toFixed(2) }
		},
		props:{
			item:{
				type:Object,
				default:{}
			},
			defalutImg:{ type:String }
		}
	}
</script>

<style lang="scss">
.goods{
			display: flex;
			border-bottom: 1rpx solid #e0e7ed;
			padding: 20rpx 15rpx;
				.left-goods{
						image{
							width: 200rpx;
							height: 200rpx;		
							margin-right: 10rpx;
						}
				 }
				 .right-goods{
					 .goods-title{
						 font-size: 26rpx;
						 height: 170rpx;
					 }
					 .goods-price{
						 color: #b02418;
					 }
				 }
		}
</style>